home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr09
/
enft2ged.zip
/
ENFT2GED.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-06-01
|
10KB
|
312 lines
1000 if COMMAND$="2" then _
line input"press <Enter> to continue";a$
1001 cls
1002 print"program=EnFT2Ged version=3-Jun-1992"
1003 print"author=Brian Harney, Frankfort, KY":_
print">>>> this program is in the public domain <<<<":_
print
1004 print"Reads individual-list report-file from the program":_
print"'Enhanced Family Tree' and writes a GEDCOM file."
1005 print"Limit of 5000 individuals."
1006 print
1010 V$="###,###"
1011 DIM F$(5000)
1012 if COMMAND$="2" then 20000
1014 if COMMAND$="3" then 30000
1050 ZC=csrlin: _
line input"input file ";FI$
1051 if FI$="" then FI$="ENFT0"
1070 open"I",1,FI$: _
locate ZC: _
print FI$;" opened for input."
1072 FO$="ENFT1"
1074 open"O",2,FO$: _
print FO$;" opened for output."
1075 print"Pass 1 of 4..."
1100 '*****
1102 if eof(1) then close: print"eof": _
locate 23,1: line input"press <Enter> to continue";a$:_
cls:_
end
1103 line input #1,a$: a=a+1: if int(a/5)*5=a then locate 12,1: print a
1108 if a$="" then 1102
1109 if a$=string$(len(a$),32) then 1102
1110 if a$=chr$(12) then 1102
1111 zq=4
1112 if left$(a$,13)<>" Name: " then 1120
1113 Gosub 2000
1114 Z$=mid$(A$,14,39): Gosub 2020: if zl<2 then beep: close: end
1115 NA$=mid$(a$,14,zl-1): NID$=mid$(a$,14+zl,z2)
1116 if len(a$)>65 then MF$=mid$(a$,66,1) else MF$="M"
1118 goto 1100
1120 if left$(a$,13)="-------------" then _
if NA$<>"" then _
Gosub 1300:_
goto 1100
1130 '---
1132 if left$(a$,12)<>"Birth place:" then 1140
1133 if len(a$)<14 then 1140
1135 BP$=mid$(a$,14,39)
1136 if len(a$)>65 then BD$=mid$(a$,66,len(a$)-65):_
Z$=BD$: gosub 7000: BD$=Z$
1137 if len(BD$)<11 then BD$=" "+BD$: goto 1137
1138 goto 1100
1140 '---
1142 if left$(a$,12)<>"Death place:" then 1160
1143 if len(a$)<14 then 1160
1145 DP$=mid$(a$,14,39)
1146 if len(a$)>65 then DD$=mid$(a$,66,len(a$)-65):_
Z$=DD$: gosub 7000: DD$=Z$
1147 if len(DD$)<11 then DD$=" "+DD$: goto 1147
1148 goto 1100
1160 '---
1162 if left$(a$,12)<>" Mother: " then 1170
1163 if len(a$)<14 then 1170
1164 Z$=mid$(A$,13,39): Gosub 2020: _
if zl<2 then beep: print"#1164": close: end
1165 MO$=mid$(a$,12,zl): MOID$=mid$(a$,13+zl,z2)
1168 goto 1100
1170 '---
1172 if left$(a$,12)<>" Father: " then 1180
1173 if len(a$)<14 then 1180
1174 Z$=mid$(A$,13,39): Gosub 2020: _
if zl<2 then beep: print"#1174": close: end
1175 FA$=mid$(a$,12,zl): FID$=mid$(a$,13+zl,z2)
1178 goto 1100
1180 '---
1182 if left$(a$,3)<>"M. " then 1199
1183 if len(a$)<9 then 1199
1184 Z$=mid$(A$,5,39): Gosub 2020: _
if zl<2 then beep: print"#1184": close: end
1185 SPID$=mid$(a$,4+zl,z2)
1188 goto 1100
1199 goto 1100
1300 '****
1302 Z$=NID$ : gosub 3100: NID$=Z$:_
Z$=FID$ : gosub 3100: FID$=Z$:_
Z$=MOID$: gosub 3100: MOID$=Z$:_
Z$=SPID$: gosub 3100: SPID$=Z$
1303 Z$=NA$ : gosub 3000: gosub 4000: NA$=Z$ :_
print #2,NID$;FID$;MOID$;SPID$;" ";NA$;MF$;" ";BD$;" ";BP$;DD$;" ";DP$;"."
1308 Z$=FA$ : gosub 3000: gosub 4000: FA$=Z$ :_
print #2,FID$;" ";FA$;string$((160-17)-len(FA$)," ");"."
1323 Z$=MO$ : gosub 3000: gosub 4000: MO$=Z$ :_
print #2,MOID$;" ";MO$;string$((160-17)-len(MO$)," ");"."
1385 gosub 2000
1390 print #2,"---"
1399 return
2000 '*****
2010 NA$="":NID$=""
2012 FA$="":FID$=""
2014 MO$="":MOID$=""
2015 BP$="":BD$=" "
2017 DP$="":DD$=" "
2019 return
2020 zl=58: if len(Z$)<57 then zl=len(Z$)+1: locate 20: print zl: print Z$
2021 zl=zl-1: if zl<2 then return
2022 if mid$(Z$,zl,1)=" " then 2021
2024 if mid$(Z$,zl,1)=")" then z2=zl: gosub 2100
2026 if mid$(Z$,zl,1)<>" " then return
2099 return
2100 '****
2101 zl=zl-1: if zl<2 then beep: print"zl<2 at 2101":print a$: close: end
2105 if mid$(z$,zl,1)="(" then z2=z2-zl: return
2106 goto 2101
3000 '****
3002 if Z$="" or Z$=" " then return
3010 if left$(Z$,1)=" " then Z$=right$(Z$,len(Z$)-1): goto 3010
3012 if right$(Z$,1)=" " then Z$=left$(Z$,len(Z$)-1): goto 3012
3020 return
3100 '****
3112 if right$(Z$,1)=")" then Z$=left$(Z$,len(Z$)-1)
3114 if left$(Z$,1)="(" then Z$=right$(Z$,len(Z$)-1)
3115 if left$(Z$,1)="#" then Z$=right$(Z$,len(Z$)-1)
3116 if right$(Z$,1)=" " then Z$=left$(Z$,len(Z$)-1): goto 3116
3118 if len(Z$)>4 then Z$=">"+left$(Z$,3)
3119 if len(Z$)<4 then Z$=" "+Z$: goto 3119
3120 return
4000 '**** put slashes around surname
4010 z=len(Z$)+1: if len(Z$)<3 then return
4020 if instr(Z$," ")=0 then return
4030 z=z-1: if z<2 then return
4032 if mid$(Z$,z,1)<>" " then 4030
4034 GIVN$=left$(Z$,z)
4035 SURN$=right$(Z$,len(Z$)-z)
4038 Z$=GIVN$+"/"+SURN$+"/"
4039 if len(Z$)<39 then Z$=Z$+" ": goto 4039
4040 return
5000 '****
5010 if I$(val(FID$))="1" then z=1 else z=0
5020 if z=0 then I$(val(FID$))="1"
5030 return
7000 '**** fix a date to European format
7002 DA$=" ": MM$="zzz": YYYY$=" ": locate 15,1: print Z$;" "
7010 if len(Z$)>5 then if right$(Z$,4)="????" then _
Z$=left$(Z$,len(Z$)-4)
7011 if len(Z$)>5 then if mid$(Z$,len(Z$)-4,1)="/" then _
YYYY$=right$(Z$,4):_
Z$=left$(Z$,len(Z$)-4)
7014 if right$(Z$,1)="/" then Z$=left$(Z$,len(Z$)-1)
7015 z=instr(Z$,"/"): _
if z=2 or z=3 then _
MM$=left$(Z$,z-1):_
if len(Z$) > z then Z$=right$(Z$,len(Z$)-z)
7017 z=instr(Z$,"/"): _
if z=2 or z=3 then _
DA$=left$(Z$,z-1)
7018 if len(Z$)=1 or len(Z$)=2 then _
if val(Z$)>0 then DA$=Z$
7019 'rint Z$;" "DA$;" ": delay 3
7020 if MM$="?" or MM$="??" or val(MM$)=0 then MM$=" "
7021 if val(MM$)=1 then MM$="Jan"
7022 if val(MM$)=2 then MM$="Feb"
7023 if val(MM$)=3 then MM$="Mar"
7024 if val(MM$)=4 then MM$="Apr"
7025 if val(MM$)=5 then MM$="May"
7026 if val(MM$)=6 then MM$="Jun"
7027 if val(MM$)=7 then MM$="Jul"
7028 if val(MM$)=8 then MM$="Aug"
7029 if val(MM$)=9 then MM$="Sep"
7030 if val(MM$)=10 then MM$="Oct"
7031 if val(MM$)=11 then MM$="Nov"
7032 if val(MM$)=12 then MM$="Dec"
7040 if len(DA$)<2 then DA$="0"+DA$
7042 if len(YYYY$)<4 then YYYY$="0"+YYYY$: goto 7042
7043 if YYYY$=" " then MM$=" "
7044 if MM$=" " then DA$=" "
7045 Z$=DA$+" "+MM$+" "+YYYY$
7047 if len(Z$)<11 then Z$=" "+Z$: goto 7047
7048 locate 16,1: print Z$;" "
7049 return
20000 '*****
20002 print"Pass 3 of 4..."
20010 open"I",1,"ENFT2":_
print "ENFT2 opened for input."
20015 open"O",2,"ENFT3":_
print "ENFT3 opened for output."
20016 line input #1,ap$: a=a+1: locate 15: print a
20017 if len(ap$)<4 then if eof(1) then 20100 else 20016
20018 if ap$="" or ap$=string$(len(ap$)," ") then if eof(1) then 20100 else 20016
20019 if ap$=string$(len(ap$)-1," ")+"." then if eof(1) then 20100 else 20016
20020 if eof(1) then 20100
20025 line input #1,a$: a=a+1: locate 15: print a
20027 if len(a$)<4 then if eof(1) then 20100 else 20025
20028 if a$="" or a$=string$(len(a$)," ") then if eof(1) then 20100 else 20025
20029 if a$=string$(len(a$)-1," ")+"." then if eof(1) then 20100 else 20016
20030 if left$(a$,4) <> left$(ap$,4) then print #2,ap$: b=b+1
20035 ap$=a$
20040 goto 20020
20100 '---
20102 if left$(a$,4) <> left$(ap$,4) then print #2,ap$: b=b+1
20104 close:_
locate 15: _
print "in>";a: _
print "out>";b: _
end
30000 '*****
30002 print"Pass 4 of 4..."
30010 open"I",1,"ENFT3":_
print "ENFT3 opened for input."
30015 open"O",2,"ENFT4.GED":_
print "ENFT4.GED opened for output."
30016 open"O",3,"ENFT4.FAM":_
print "ENFT4.FAM opened for output."
30017 gosub 30800
30020 if eof(1) then 30100
30022 line input #1,a$: a=a+1: locate 15: print a
30030 gosub 30600
30099 goto 30020
30100 '---
30104 locate 21
30105 print #3,"0 TRLR"
30198 close 3
32000 '---
32002 open"I",3,"ENFT4.FAM"
32004 if eof(3) then close: _
print"output is in ENFT4.GED":_
end
32006 line input #3,a$
32008 print #2,a$
32010 goto 32004
30600 '**** reserved for future use
30602 NID$=mid$(a$,1,4) : Z$=NID$: gosub 30700 : NID$=Z$
30603 print #2,"0 @I";NID$;"@ INDI"
30604 NA$=mid$(a$,18,39) : Z$=NA$ : gosub 30700 : NA$=Z$
30605 print #2,"1 NAME ";NA$
30610 SEX$=mid$(a$,57,1): _
print #2,"1 SEX ";SEX$
30620 BD$=mid$(a$,59,11) : Z$=BD$: gosub 30700: BD$=Z$
30622 BP$=mid$(a$,71,38) : Z$=BP$: gosub 30700: BP$=Z$
30624 DD$=mid$(a$,110,11): Z$=DD$: gosub 30700: DD$=Z$
30626 DP$=mid$(a$,122,37): Z$=DP$: gosub 30700: DP$=Z$
30630 if BD$=" " and BP$=" " then 30640
30631 print #2,"1 BIRT"
30632 print #2,"2 DATE ";BD$
30633 if BP$=" " then 30640
30634 print #2,"2 PLAC ";BP$
30640 if DD$=" " and DP$=" " then 30650
30641 print #2,"1 DEAT"
30642 print #2,"2 DATE ";DD$
30643 if DP$=" " then 30650
30644 print #2,"2 PLAC ";DP$
30650 FF$=mid$(a$,5,8): if FF$=" " then 30699
30652 gosub 30900: Z$=FF$: gosub 30700: FF$=Z$
30654 print #2,"1 FAMC @F";FF$;"@"
30660 '---
30662 print #3,"0 @F";FF$;"@ FAM"
30664 FA$=mid$(a$,5,4): if FA$=" " then 30665 else _
Z$=FA$: gosub 30700: FA$=Z$: _
print #3,"1 HUSB @I";FA$;"@"
30665 MO$=mid$(a$,9,4): if MO$=" " then 30699 else _
Z$=MO$: gosub 30700: MO$=Z$: _
print #3,"1 WIFE @I";MO$;"@"
30699 return
30700 '---
30701 if len(Z$)>1 then _
if right$(Z$,1)=" " then _
Z$=left$(Z$,len(Z$)-1): goto 30701
30702 if len(Z$)>1 then _
if left$(Z$,1)=" " then _
Z$=right$(Z$,len(Z$)-1): goto 30702
30703 return
30800 '****
30802 PRINT#2,"0 HEAD":_
PRINT#2,"1 SOUR ENH-FAM-TREE":_
PRINT#2,"2 VERS 2.10":_
PRINT#2,"1 DEST Generic":_
PRINT#2,"1 DATE 02 JUN 1992":_
PRINT#2,"1 CHAR IBMPC":_
PRINT#2,"1 FILE xxx.GED"
30804 PRINT#2,"0 @S1@ SUBM":_
PRINT#2,"1 NAME Brian D. Harney":_
PRINT#2,"1 ADDR 111 Willowcrest Dr":_
PRINT#2,"2 CONT Frankfort, KY 40601":_
PRINT#2,"1 PHON (502) 875-4452"
30809 return
30900 '*****
30902 z=0
30904 z=z+1: _
locate 17: print "curr-fam-number>";z: _
if z>zhi then 30920
30906 if F$(z)=FF$ then FF$=str$(z): return
30910 goto 30904
30920 zhi=zhi+1: _
locate 18: print "high-fam-number>";zhi
30922 F$(zhi)=FF$: FF$=str$(zhi)
30924 return